package com.kkd.kkdapp.adapter;

import java.util.List;

import u.aly.co;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.kkd.kkdapp.R;
import com.kkd.kkdapp.http.entity.ExperienceGoldDetailDataItem;

public class ExperienceGoldDetailAdapter extends BaseAdapter {
	private Context mContext;
	private LayoutInflater inflater;
	private List<ExperienceGoldDetailDataItem> list;

	public ExperienceGoldDetailAdapter(Context context,
			List<ExperienceGoldDetailDataItem> list) {
		mContext = context;
		inflater = LayoutInflater.from(mContext);
		this.list = list;
	}

	@Override
	public int getCount() {
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder = null;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = inflater.inflate(R.layout.item_datail_experiencegold,
					parent, false);
			holder.tv_title_item_detail_experienceGold = (TextView) convertView
					.findViewById(R.id.tv_title_item_detail_experienceGold);
			holder.tv_time_item_detail_experienceGold = (TextView) convertView
					.findViewById(R.id.tv_time_item_detail_experienceGold);
			holder.tv_amount_item_detail_experienceGold = (TextView) convertView
					.findViewById(R.id.tv_amount_item_detail_experienceGold);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		holder.tv_title_item_detail_experienceGold.setText(list.get(position)
				.getTradeDesc());
		holder.tv_time_item_detail_experienceGold.setText(list.get(position)
				.getCreateTime());
		holder.tv_amount_item_detail_experienceGold.setText(list.get(position)
				.getAmount());
		return convertView;
	}

	class ViewHolder {
		TextView tv_title_item_detail_experienceGold;
		TextView tv_time_item_detail_experienceGold;
		TextView tv_amount_item_detail_experienceGold;
	}
}
